package map.android.baidu.carpool.data.impl;

import android.content.Context;
import map.android.baidu.carpool.WebConfig;
import map.android.baidu.carpool.data.CarpoolBaseData;
import map.android.baidu.carpool.response.GetPayResponse;
import map.android.baidu.carpool.setting.UserInfoSetting;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by zhangtongyu on 15/3/24.
 * pay模块获取支付参数接口request
 */
public class GetPayData extends CarpoolBaseData<GetPayResponse>{

    private String orderId;
    private String sdk = "1";
    private String bduss;
    private String discountId;

    public GetPayData(Context context) {
        super(context);
    }

    public void setBduss(String bduss) {
        this.bduss = bduss;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public void setSdk(String sdk) {
        this.sdk = sdk;
    }

    public void setdiscountId(String discountId) {
        this.discountId = discountId;
    }

    @Override
    protected String getUrl() {
        return WebConfig.getUrl(WebConfig.URL_ID_GET_PAY);
    }

    @Override
    protected Map<String, String> getParams() {
        Map<String , String> params = new HashMap<String, String>();
        params.put("orderId" , orderId);
        params.put("sdk" , sdk);
        params.put("bduss" , UserInfoSetting.getBduss());
        if (discountId != null) {
            params.put("discountId", discountId);
        }
        return params;
    }
}
